import apibase from "@/api/apiBase";
import axios from "axios";
import { modifyMobileInterface, modifyPwd, savePersonInfo, userAuthentication, verifyIdentity, verifyModifyMobile } from "./account.interface";

//企业认证信息提交
export const $userAuthentication = (params: userAuthentication) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/authentication',
    data: params,
    instance,
  });
}

//企业认证状态
export const $userAuthStatus = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/api/user/authStatus',
    data: {},
    instance,
  });
}

//个人信息提交
export const $savePersonInfo = (params: savePersonInfo) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/savePersonInfo',
    data: params,
    instance,
  });
}

//获取个人信息
export const $personInfo = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/api/user/personInfo',
    data: {},
    instance,
  });
}

//修改密码 —— 身份验证
export const $verifyIdentity = (params: verifyIdentity) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/verifyIdentity',
    data: params,
    instance,
  });
}

//修改密码 —— 修改密码
export const $modifyPwd = (params: modifyPwd) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/modifyPwd',
    data: params,
    instance,
  });
}

//修改手机号 —— 身份验证
export const $verifyModifyMobile = (params: verifyModifyMobile) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/verifyModifyMobile',
    data: params,
    instance,
  });
}

//修改手机号 —— 修改手机号
export const $modifyMobile = (params:modifyMobileInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/api/user/modifyMobile',
    data: params,
    instance,
  });
}
